Take a string to a byte[]
        Posted  
        
            by Vaccano
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Vaccano
        
        
        
        Published on 2010-04-19T19:30:15Z
        Indexed on 
            2010/04/19
            19:33 UTC
        
        
        Read the original article
        Hit count: 184
        
I have a string in my database that represents an image. It looks like this:
0x89504E470D0A1A0A0000000D49484452000000F00000014008020000000D8A66040....
<truncated for brevity>
When I load it in from the database it comes in as a byte[]. How can I convert the string value to a byte array myself. (I am trying to remove the db for some testing code.)
© Stack Overflow or respective owner